section .text
	global strcasecmp

strcasecmp:
	xor rax, rax
	jmp .comp

.negatif:
	sub bl, al
	mov al, bl
	neg rax
	jmp endcmp

.positif:
	sub al, bl
	jmp endcmp

.same:
	mov rax, 0
	jmp endcmp

.count:
	inc rdi
	inc rsi

.comp:
	mov al, byte [rdi]
	call check_al
	mov bl, byte [rsi]
	call check_bl
	cmp al, bl
	jb .negatif
	jg .positif
	cmp al, 0
	je .same
	jmp .count

check_al:
	cmp al, 65
	jb endcmp
	cmp al, 90
	jg endcmp
	add al, 32
	ret

check_bl:
	cmp bl, 65
	jb endcmp
	cmp bl, 90
	jg endcmp
	add bl, 32
	ret

endcmp:
	ret